package indi.zhifa.study2024.nbr.controller;

import indi.zhifa.core.common.web.entity.ann.ZhiFaRestController;
import indi.zhifa.study2024.nbr.logic.curd.account.IDomainAssignService;
import indi.zhifa.study2024.nbr.logic.curd.account.entity.request.AssignDomainRequest;
import indi.zhifa.study2024.nbr.logic.curd.account.entity.response.AssignDomainResponse;
import indi.zhifa.study2024.nbr.util.Constant;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

@Slf4j
@Validated
@RequiredArgsConstructor
@RequestMapping(value = Constant.ControllerBusyPrefix + "/user/auth")
@ZhiFaRestController
@Tag(name = "用户权限管理")
public class UserAuthController {

    private final IDomainAssignService mDomainAssignService;

    @Operation(summary = "分配片区")
    @PostMapping("/domain/assign")
    public AssignDomainResponse assignDomain(Long pUserId, AssignDomainRequest pAssignDomainRequest) {
        AssignDomainResponse assignDomainResponse = mDomainAssignService.assignDomain(pUserId, pAssignDomainRequest);
        return assignDomainResponse;
    }


}
